<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">

    <title>Document</title>
</head>

<body>
    <div id="app">
        <button @click="age10">年龄改10</button>
        <button @click="age18">年龄改18</button>

        <img src="https://csdnimg.cn/medal/chizhiyiheng@240.png" alt="">
        <img v-show=isShow src="https://csdnimg.cn/medal/zhuanlandaren@240.png" alt="">
        <img v-show="age>=18" src="https://csdnimg.cn/medal/zhuanlandaren@240.png" alt="">
    </div>

    <script src="./vue.js"></script>
    <script>
        var app = new Vue({
            el: "#app",
            data: {
                isShow: true,
                age: 16
            },
            methods: {
                age10: function() {
                    console.log("age=10");
                    this.age = 10;
                },
                age18: function() {
                    console.log("age=18");
                    this.age = 18;
                }
            }
        })
    </script>
</body>

</html>